package jtk.project4.fleet.templateField;

import javax.swing.SortOrder;

import nl.coderight.jazz.form.FormLayout;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;

public class ContohTableField extends GroupControl{
	private TableField contohTable ;
	
	
	public ContohTableField(String bindID){
		setBindID(bindID);
		createFields();
		createLayout();
	}
	
	private void createFields(){
		//setup table
		contohTable = new TableField("nama domains (pake 's')","nama domain");
		contohTable.setTitle("contohTable.header.table");
		contohTable.setAutoResizeMode(AutoResizeMode.OFF);
		contohTable.getSelectionValues();
		
		//add columns
		contohTable.addColumn("label.column1","attr1");
		contohTable.addColumn("label.column2","attr2");
		contohTable.addColumn("label.column3","attr3");
		contohTable.addColumn("label.column4","attr4");
		contohTable.addColumn("label.column5","attr5");		
		
		//Sort
		contohTable.sort("unit", SortOrder.ASCENDING);
	}
	
	private void createLayout() {
		setLayout(new FormLayout())
		.addField(contohTable);
	}
}
